/**
 * 
 */
package de.cbf.cam.frame.handlers;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.handlers.HandlerUtil;

/**
 * @author Nebelritter
 *
 */
public class OpenPreferencesHandler extends AbstractHandler {

	/**
	 * 
	 */
	public OpenPreferencesHandler() {		
	}

	/* (non-Javadoc)
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
	 */
	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {		
		IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
		PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(window.getShell(),null,null,null);
		dialog.open();	
		
		return null;
	}

}
